@@ -4,6 +4,11 @@ import type {
44 PolicyActionClass ,
55 getAuthSession ,
66} from '@coop/shared' ;
7+ import { buildArchiveExecutors } from './executors/archive' ;
8+ import { buildErc8004Executors } from './executors/erc8004' ;
9+ import { buildGreenGoodsExecutors } from './executors/green-goods' ;
10+ import { buildOnchainExecutors } from './executors/onchain' ;
11+ import { buildReviewExecutors } from './executors/review' ;
712
813/** Context passed from handleExecuteAction into each executor. */
914export interface ActionExecutorContext {
@@ -20,31 +25,12 @@ export type ExecutorResult = Promise<{ ok: boolean; error?: string; data?: unkno
2025
2126/**
2227 * Build the action executor map used by `handleExecuteAction`.
23- *
24- * Each executor module is loaded on first call rather than eagerly with the
25- * background bundle. The simple-mode demo only fires a small slice of action
26- * classes (capture/publish); deferring erc8004, green-goods, and onchain
27- * executors keeps them out of the SW cold-start path.
2828 */
2929export async function buildActionExecutors (
3030 ctx : ActionExecutorContext ,
3131) : Promise <
3232 Partial < Record < PolicyActionClass , ( payload : Record < string , unknown > ) => ExecutorResult > >
3333> {
34- const [
35- { buildArchiveExecutors } ,
36- { buildReviewExecutors } ,
37- { buildGreenGoodsExecutors } ,
38- { buildErc8004Executors } ,
39- { buildOnchainExecutors } ,
40- ] = await Promise . all ( [
41- import ( './executors/archive' ) ,
42- import ( './executors/review' ) ,
43- import ( './executors/green-goods' ) ,
44- import ( './executors/erc8004' ) ,
45- import ( './executors/onchain' ) ,
46- ] ) ;
47-
4834 return {
4935 ...buildArchiveExecutors ( ctx ) ,
5036 ...buildReviewExecutors ( ctx ) ,
0 commit comments