Add orchestrator types and error handling configurations

- Introduced new TypeScript types for orchestrator functionality, including `SessionStrategy`, `ErrorHandlingStrategy`, and `OrchestrationStep`.
- Defined interfaces for `OrchestrationPlan` and `ManualOrchestrationParams` to facilitate orchestration management.
- Added a new PNG image file for visual representation.
- Created a placeholder file named 'nul' for future use.
This commit is contained in:
catlog22
2026-02-14 12:54:08 +08:00
parent cdb240d2c2
commit 4d22ae4b2f
56 changed files with 4767 additions and 425 deletions

View File

@@ -157,21 +157,33 @@ export const useQueueExecutionStore = create<QueueExecutionStore>()(
// ========== Selectors ==========
/** Stable empty array to avoid new references */
const EMPTY_EXECUTIONS: QueueExecution[] = [];
/** Select all executions as a record */
export const selectQueueExecutions = (state: QueueExecutionStore) => state.executions;
/** Select only currently running executions */
/**
* Select only currently running executions.
* WARNING: Returns new array each call — use with useMemo in components.
*/
export const selectActiveExecutions = (state: QueueExecutionStore): QueueExecution[] => {
return Object.values(state.executions).filter((exec) => exec.status === 'running');
const all = Object.values(state.executions);
const running = all.filter((exec) => exec.status === 'running');
return running.length === 0 ? EMPTY_EXECUTIONS : running;
};
/** Select executions for a specific queue item */
/**
* Select executions for a specific queue item.
* WARNING: Returns new array each call — use with useMemo in components.
*/
export const selectByQueueItem =
(queueItemId: string) =>
(state: QueueExecutionStore): QueueExecution[] => {
return Object.values(state.executions).filter(
const matched = Object.values(state.executions).filter(
(exec) => exec.queueItemId === queueItemId
);
return matched.length === 0 ? EMPTY_EXECUTIONS : matched;
};
/** Compute execution statistics by status */