feat(strategies): publish type-only strategy authoring API (CL31)
This commit is contained in:
parent
a411f9a665
commit
3a63b2039e
13 changed files with 300 additions and 121 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import type { StrategyContext, StrategyProgram } from '@stock-bot/research/strategy-api';
|
||||
import type * as AuthorAPI from '@stock-bot/research/strategy-api';
|
||||
import type { FinancialDecimal, FinancialStrategyIntent } from '@stock-bot/types';
|
||||
import type {
|
||||
StrategyContext,
|
||||
StrategyProgram,
|
||||
} from '../../apps/stock/orchestrator/src/contracts/canonical-strategy';
|
||||
// Existing hosts keep the same contract while external authors use the public subpath.
|
||||
import type { StrategyProgram as LegacyProgram } from '../../apps/stock/orchestrator/src/contracts/canonical-strategy';
|
||||
|
||||
type State = { count: number; indicator: { values: number[] } };
|
||||
|
||||
|
|
@ -61,3 +61,14 @@ const asynchronous: StrategyProgram<State> = {
|
|||
}),
|
||||
};
|
||||
void asynchronous;
|
||||
|
||||
const legacyProgram: LegacyProgram<State> = valid;
|
||||
const publicProgram: StrategyProgram<State> = legacyProgram;
|
||||
void publicProgram;
|
||||
|
||||
// @ts-expect-error The author package exposes no strategy execution controller.
|
||||
type _Controller = AuthorAPI.StrategyController;
|
||||
// @ts-expect-error Native replay handles remain host-private.
|
||||
type _NativeSession = AuthorAPI.NativeReplaySession;
|
||||
// @ts-expect-error Strategy decisions cannot construct a paper runtime.
|
||||
type _PaperRuntime = AuthorAPI.CanonicalPaperRuntime;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue