openclaw/test
Peter Steinberger 062f88e3e3
refactor: extract reusable AI runtime package (#99059)
* refactor: extract reusable AI runtime package

* refactor: complete AI provider relocation

* refactor: keep llm core internal

* refactor(ai): make @openclaw/ai self-contained with host policy ports

Move pure transport helpers (tool projections, strict-schema normalization,
prompt-cache boundary, stream guards, anthropic/openai compat, request
activity) from src into packages/ai; move utf16-slice into
normalization-core. Inject host policy (guarded fetch, redaction,
strict-tool defaults, diagnostics logging) through AiTransportHost with
inert library defaults installed by src/llm/stream.ts. Narrow the public
barrel to instance-scoped createApiRegistry/createLlmRuntime; the
process-default runtime moves behind internal/ and
registerBuiltInApiProviders takes an explicit registry. Delete the
src/llm/api-registry re-export facade.

* fix(ai): teach node, jiti, and vite resolvers the @openclaw/ai and utf16-slice subpaths

The workspace alias tables in root-alias.cjs, plugin-sdk-native-resolver,
sdk-alias, the shared vitest config, and the Control UI vite config only
knew @openclaw/llm-core; Node-side plugin loading resolved @openclaw/ai
through the pnpm symlink to the unbuilt dist (checks-node-compact CI
failures), and the Control UI build broke on the new
normalization-core/utf16-slice subpath.

* chore(ui): drop leftover service-worker debug logging

* build(release): ship @openclaw/ai with its own shrinkwrap and honest dependency set

packages/ai declares only its six real runtime deps (kysely, chalk, json5,
tslog, zod, fs-safe, and proxyline were never imported); orphaned root deps
removed. generate-npm-shrinkwrap now treats publishable packages/* like
publishable plugins so the AI tarball pins its transitive tree even though
workspace deps are omitted from the root shrinkwrap. knip learns the
package entry points; the tsdown dts neverBundle option moves to its
documented deps.dts home; the README documents the no-semver internal/*
contract and host ports.

* docs(ai): add minimal external-consumer example app

examples/ai-chat consumes only the public @openclaw/ai surface (built dist
via the workspace link): isolated runtime, built-in provider registration,
one streamed completion. Supports Anthropic/OpenAI via env keys and a
keyless local Ollama target; live-verified against Ollama.

* docs(ai): document the @openclaw/ai package and workspace shrinkwrap boundary

* chore(check): include examples/ in duplicate-scan targets

* fix: emit normalization package subpaths

* fix: complete AI package boundary artifacts

* fix: align AI package boundary contracts

* fix(ci): stabilize package release contracts

* test: align documentation contract checks

* test: keep cron docs guard aligned

* test: align restored docs contract guards

* test: follow upstream docs contracts

* docs: drop superseded talk wording
2026-07-05 01:56:40 -04:00
..
e2e/qa-lab refactor: extract reusable AI runtime package (#99059) 2026-07-05 01:56:40 -04:00
fixtures fix(agents): surface Claude CLI thinking token progress 2026-07-04 19:43:11 -07:00
helpers fix(tui): preserve queued prompt lifecycle (#100123) 2026-07-04 21:15:28 -04:00
mocks
proof
scripts refactor: extract reusable AI runtime package (#99059) 2026-07-05 01:56:40 -04:00
tsconfig feat: refactor the Control UI architecture 2026-07-04 23:19:38 +01:00
vitest refactor: extract reusable AI runtime package (#99059) 2026-07-05 01:56:40 -04:00
_proof_twilio_json_guard.mts fix(sms): guard Twilio JSON.parse against malformed API response bodies (#97999) 2026-06-30 18:15:08 -07:00
AGENTS.md
appcast.test.ts
architecture-smells.test.ts
CLAUDE.md
cli-json-stdout.e2e.test.ts
extension-import-boundaries.test.ts
extension-package-tsc-boundary.test.ts
extension-test-boundary.test.ts
gateway.multi.e2e.test.ts
git-hooks-pre-commit.test.ts fix(git-hooks): skip sequencer pre-commit formatting (#95842) 2026-06-25 16:40:12 +08:00
global-setup.ts
image-generation.infer-cli.live.test.ts
image-generation.runtime.live.test.ts
non-isolated-runner.ts
npm-publish-plan.test.ts
official-channel-catalog.test.ts
openclaw-launcher.e2e.test.ts fix: reject incompatible Node 23 runtimes (#99832) 2026-07-04 00:03:49 -07:00
openclaw-npm-postpublish-verify.test.ts fix(release): surface installed extension manifest errors 2026-06-23 10:26:10 +02:00
openclaw-npm-prepublish-verify.test.ts refactor: extract reusable AI runtime package (#99059) 2026-07-05 01:56:40 -04:00
openclaw-npm-release-check.test.ts
openclaw-prepack.test.ts fix(release): preserve npm pack json output 2026-06-24 09:19:00 +02:00
package-manager-config.test.ts fix(install): skip llama cpp native build by default 2026-06-23 12:58:41 +08:00
package-scripts.test.ts fix(build): restore plugin SDK strict smoke alias 2026-07-04 06:44:57 +02:00
plugin-clawhub-release.test.ts fix(release): block stale Codex runtime pins (#100015) 2026-07-04 15:13:31 -06:00
plugin-extension-import-boundary.test.ts
plugin-npm-package-manifest.test.ts
plugin-npm-release.test.ts fix(release): block stale Codex runtime pins (#100015) 2026-07-04 15:13:31 -06:00
plugin-npm-runtime-build.test.ts
qa-convex-credential-payload-validation.test.ts
release-check.test.ts
setup-home-isolation.test.ts
setup-openclaw-runtime.ts
setup.extensions.ts
setup.shared.ts
setup.ts
stable-release-closeout.test.ts
test-env.test.ts fix: route install env test mutations 2026-06-24 20:10:42 +01:00
test-env.ts fix: centralize isolated test env writes 2026-06-24 20:01:36 +01:00
test-helper-extension-import-boundary.test.ts
tsconfig.json
ui.presenter-next-run.test.ts feat: refactor the Control UI architecture 2026-07-04 23:19:38 +01:00
vitest-boundary-config.test.ts
vitest-light-paths.test.ts
vitest-performance-config.test.ts
vitest-projects-config.test.ts feat: refactor the Control UI architecture 2026-07-04 23:19:38 +01:00
vitest-scoped-config.test.ts feat: refactor the Control UI architecture 2026-07-04 23:19:38 +01:00
vitest-ui-package-config.test.ts
vitest-unit-config.test.ts
vitest-unit-fast-config.test.ts feat: refactor the Control UI architecture 2026-07-04 23:19:38 +01:00
vitest-unit-paths.test.ts
web-provider-boundary.test.ts