Files
vercel__workflow/packages/web/app/lib/workflow-api-client.ts
Karthik Kalyan 371f06e5ac feat(web): bulk-cancel selected runs from the runs table (#3349)
* feat(cli): bulk-cancel runs in a single operation

Replace the per-run cancel loop in `workflow cancel` with one `cancelRuns`
call, validate `--limit` (1-500), print a compact outcome summary with
per-run lines for surfaced failures, and exit nonzero only when a run fails.
The bulk logic lives in a dependency-injected `performBulkCancel` helper so it
is unit-testable without an oclif harness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(cli): address bulk cancel review feedback

* feat(web): bulk-cancel selected runs in a single request

Thread a bulkCancelRuns action through the server action, RPC route,
rpc-client, and client wrappers, backed by core's cancelRuns. The runs table
now cancels the selected pending/running runs in one call, caps a batch at
BULK_CANCEL_MAX_RUN_IDS (disabling the button with guidance above the cap),
and reports a single outcome-summary toast covering only the categories that
occurred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-05 14:54:33 -07:00

50 lines
1.7 KiB
TypeScript

/**
* Barrel re-export for backward compatibility.
*
* All public APIs are defined in focused modules under:
* - ~/lib/client/workflow-errors.ts (error class, unwrap helpers)
* - ~/lib/client/workflow-primitives.ts (generic data-fetching utilities)
* - ~/lib/client/workflow-actions.ts (server action wrappers)
* - ~/lib/client/workflow-streams.ts (stream read/list functions)
* - ~/lib/client/hooks/use-paginated-list.ts (pagination hooks)
* - ~/lib/client/hooks/use-trace-viewer.ts (trace viewer data hook)
* - ~/lib/client/hooks/use-resource-data.ts (resource detail hook)
* - ~/lib/client/hooks/use-workflow-streams.ts (streams list hook)
*
* Consumers can import directly from those modules or from this barrel.
*/
export type { ResumeHookResult } from '~/lib/types';
export {
useInfiniteList,
useWorkflowRunsInfinite,
} from './client/hooks/use-infinite-list';
export { useLoadMoreOnScroll } from './client/hooks/use-load-more-on-scroll';
export {
usePaginatedList,
useWorkflowHooks,
useWorkflowRuns,
} from './client/hooks/use-paginated-list';
export {
fetchSpanDetailResource,
useWorkflowResourceData,
} from './client/hooks/use-resource-data';
export { useWorkflowTraceViewerData } from './client/hooks/use-trace-viewer';
export { useWorkflowStreams } from './client/hooks/use-workflow-streams';
export {
bulkCancelRuns,
cancelRun,
fetchHookToken,
recreateRun,
reenqueueRun,
resumeHook,
wakeUpRun,
} from './client/workflow-actions';
export {
getErrorMessage,
getErrorTitle,
unwrapServerActionResult,
WorkflowWebAPIError,
} from './client/workflow-errors';
export { listStreams, readStream } from './client/workflow-streams';