Commit Graph

22 Commits

Author SHA1 Message Date
Alexey Zaytsev 94373d815d feat(ai): add shared contentText utility (#6840)
Co-authored-by: Armin Ronacher <armin.ronacher@active-4.com>
2026-07-20 01:50:36 +02:00
Mario Zechner 9ab1292679 feat(agent): Models is the harness's only auth path
Remove AgentHarnessOptions.getApiKeyAndHeaders: turn streaming,
compaction, and branch summarization resolve auth exclusively through
the injected Models instance. compact()/generateSummary()/
generateBranchSummary() lose their explicit apiKey/headers parameters.
2026-06-10 21:39:13 +02:00
Mario Zechner f0ccbbf011 feat(agent): AgentHarness streams through a required Models instance (phase 6)
AgentHarnessOptions.models is required; the harness stream path,
compaction, and branch summarization go through models.streamSimple()/
completeSimple() instead of the compat globals. getApiKeyAndHeaders
stays and wins per-field over provider-resolved auth, but is no longer
required: without it, requests resolve through provider auth.

compact()/generateSummary()/generateBranchSummary() take a Models
parameter; explicit apiKey becomes optional. StreamFn is redefined
structurally (Models.streamSimple satisfies it), dropping the compat
type dependency from agent types.

Harness tests build per-file Models collections with fauxProvider()
and unique provider ids instead of mutating the global api-registry.
2026-06-10 21:27:21 +02:00
Mario Zechner 8a0903ebf2 feat(ai): compat entrypoint, core-only root barrel (phase 5)
The root barrel is now core-only and side-effect free: types,
createModels/createProvider, auth substrate, lazyStream/lazyApi, faux,
utils. Generated catalogs, api-registry, env-api-keys, images, global
stream functions, and per-API lazy wrappers leave the root.

New @earendil-works/pi-ai/compat preserves the old surface verbatim as
a strict superset of the root: api-dispatch stream/complete with env
key injection, the builtin registration side effect (skip-if-present so
it cannot clobber earlier overrides), deprecated getModel/getModels/
getProviders aliases of the new getBuiltin* reads in providers/all,
lazy api wrappers + setBedrockProviderModule, and image generation.
Compat dies with the coding-agent ModelManager migration.

Packaging: exports map gains ./compat, ./providers/*, ./api/*;
sideEffects array lists only the effectful modules.

Old-global imports across agent/coding-agent/examples and pi-ai tests
switch to /compat (path-only; compat is a superset). The coding-agent
extension loader resolves the pi-ai ROOT specifier to compat, so
existing user extensions using the old global API keep working at
runtime until compat is removed. vitest configs alias /compat to src;
browser smoke imports old globals from /compat.
2026-06-10 21:17:12 +02:00
Mario Zechner b63d26332f Finish harness tool registry semantics 2026-05-28 12:34:02 +02:00
Armin Ronacher ae9450dc51 chore(ts): use source import extensions 2026-05-20 00:04:03 +02:00
Mario Zechner 4f40f62b7b refactor(agent): harden harness session semantics 2026-05-16 00:32:16 +02:00
Mario Zechner a31ce0f47f refactor(agent): return results from compaction helpers 2026-05-14 21:56:45 +02:00
Mario Zechner b7ea82105a refactor(agent): run harness loop directly 2026-05-14 21:33:34 +02:00
Mario Zechner c0f416aabc feat(agent): add harness stream configuration 2026-05-10 18:13:16 +02:00
Mario Zechner e25415dd5f refactor(agent): finalize harness resource config 2026-05-10 00:49:00 +02:00
Mario Zechner 79db9d62ef refactor(agent): make harness resources explicit 2026-05-10 00:18:50 +02:00
Mario Zechner 322759a3f0 refactor(agent): snapshot harness turn state 2026-05-09 23:34:58 +02:00
Mario Zechner 401017a3e8 refactor(agent): rename resource formatting helpers 2026-05-09 19:44:08 +02:00
Mario Zechner 90c017b05b Merge remote-tracking branch 'origin/main' into bigrefactor
# Conflicts:
#	package-lock.json
#	packages/agent/package.json
2026-05-08 13:38:20 +02:00
Mario Zechner e1647aaa00 refactor(agent): make resource invocation explicit 2026-05-08 13:35:54 +02:00
Mario Zechner 617d8b317d refactor(agent): tighten harness environment and resources 2026-05-06 19:41:17 +02:00
Mario Zechner e1ca501da8 refactor(agent): expose concrete harness 2026-05-06 13:21:08 +02:00
Mario Zechner 530f14c018 refactor(agent): expose concrete harness session 2026-05-06 12:57:19 +02:00
Mario Zechner cdde2e893d refactor(agent): consolidate harness session abstraction 2026-05-03 22:01:40 +02:00
Mario Zechner 83599e789d feat(agent): split harness compaction and session modules 2026-05-03 03:13:45 +02:00
Mario Zechner a5b27367d3 feat(agent): add initial harness foundation 2026-05-03 00:35:36 +02:00