Skip to content

feat/workbench-llm-tools-retrieval - #5

Merged
ketd merged 1 commit into
mainfrom
feat/workbench-llm-tools-retrieval
Nov 6, 2026
Merged

ketd merged 1 commit into
mainfrom
feat/workbench-llm-tools-retrieval

Conversation

@ketd

@ketd ketd commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Stacked on #4 (base is its branch); GitHub retargets this PR to main once #4 merges.

Syncs the template with the desktop change add-workbench-llm-tools-retrieval-and-guards.

SDK

  • llm.generateText / streamText accept messages (one of prompt or messages), tools, toolChoice and reasoning.
  • Results include toolCalls (finishReason: 'TOOL_CALLS', inputError when arguments fail the tool schema) and an assistant message to append unchanged. Its hostState is reasoning material encrypted by the Host. streamText also emits tool-call events.
  • llm.embed({ model, input }) requires an explicit model. llm.rerank({ query, documents, topN? }) returns results sorted by score.
  • New sdk/vectors.mts: cosineSimilarity, topK, vectorToBlob and vectorFromBlob, for keeping vectors in the app's own SQLite.

Tooling

  • workbench:check scans server code with the TypeScript checker. It records Host methods newer than the baseline (for example llm.embed) and new text-call fields (llm.messages, llm.tools, llm.reasoning, llm.images) in manifest.requires.operations. If nothing is beyond the baseline, the field is omitted so older clients can still install the app.
  • The manifest contract accepts requires.operations, and the compilation report carries operations.

Docs

  • references/llm.md covers the tool loop, retrieval and required operations. The topic row in SKILL.md is updated.

Verification

  • pnpm exec tsc -p tooling/tsconfig.sdk.json --noEmit and tooling/tsconfig.json --noEmit pass
  • pnpm run skills:check passes
  • pnpm run test:tooling: 35/35 pass, including a new test that checks the scan writes requires and omits it for baseline-only apps

🤖 Generated with Claude Code

…operations

- llm.generateText/streamText accept messages, tools, toolChoice and reasoning;
  results carry toolCalls and an assistant message with encrypted hostState
- llm.embed (explicit model) and llm.rerank, plus sdk/vectors.mts for local
  cosine similarity, top-k and SQLite BLOB conversion
- workbench:check scans server code and records Host operations beyond the
  baseline in manifest.requires.operations so older clients ask to update
- references/llm.md documents the tool loop, retrieval and required operations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ketd
ketd changed the base branch from feat/workbench-model-media-capabilities to main November 6, 2026 10:52
@ketd
ketd merged commit 67b8b61 into main Nov 6, 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