@aidex/strategies
v1.1.0
Published
Aidex Strategies — concrete Strategy implementations built on @aidex/core, provider-agnostic.
Downloads
1,063
Maintainers
Readme
@aidex/strategies
Installation
pnpm add @aidex/strategiesnpm install @aidex/strategiesConcrete Strategy implementations for the Aidex kernel (@aidex/core). Strategies
are application-land code per docs/architecture/strategy-development-guide.md —
this package supplies reusable ones so an app can
aidex.registerStrategy(new TextGenerationStrategy()) without hand-rolling the
Prompt/Provider plumbing every time.
Contents
stub/StubStrategy— the referenceStrategyimplementation: receives anAidexRequest, readsExecutionContext, builds aPrompt, callscontext.provider.generate(), and returns the result — with no decision logic of its own. Deterministic whenevercontext.provideris.text/TextGenerationStrategy— the first productionStrategy: turnsrequest.inputinto aPromptand returnsProviderResponse.contentonly. Never imports a vendor SDK and never assumes whichProviderit's talking to — it only ever calls theProviderinterface, so it works unchanged againstGeminiProvider, a futureOpenAIProvider/ClaudeProvider, or a stub.
Rules this package follows
- Imports only the public contracts from
@aidex/core(Strategy,AidexRequest,ExecutionContext,Prompt) — never a kernel internal. - Never constructs a
Provider— always calls the one injected atcontext.provider, per doc #5's "what a Strategy must never do." - Prompt construction stays inside the strategy; it is never pushed down into a provider.
@aidex/providers(StubProvider) is a test-only dependency, used to exercise these strategies end-to-end — it is not a runtime dependency of any strategy here, since a strategy must work with anyProvider.src/index.tsexports strategy classes only.
