@karmaniverous/jeeves-scripts-core
    Preparing search index...

    Interface TaskFileDispatcherDeps

    Collaborators of dispatchTaskFile, injectable for tests.

    interface TaskFileDispatcherDeps {
        dispatchWithSlack: (
            task: string,
            options: DispatchOptions,
            slackConfig: {
                accountId?: string;
                posts?: {
                    editTs?: string[];
                    pin?: boolean;
                    purpose: string;
                    target: string;
                }[];
                reads?: {
                    label: string;
                    limit?: number;
                    target: string;
                    threadTs?: string;
                }[];
            },
            flags?:
                | readonly string[]
                | Partial<ParsedArgs<{ dryRun: FlagSpec; printTask: FlagSpec }>>,
        ) => Promise<WorkerSlackResult>;
        log: (message: string) => void;
        now: () => Date;
        runDispatcher: (task: string, options: DispatchOptions) => void;
        runMode?: () => RunMode;
    }
    Index
    dispatchWithSlack: (
        task: string,
        options: DispatchOptions,
        slackConfig: {
            accountId?: string;
            posts?: {
                editTs?: string[];
                pin?: boolean;
                purpose: string;
                target: string;
            }[];
            reads?: {
                label: string;
                limit?: number;
                target: string;
                threadTs?: string;
            }[];
        },
        flags?:
            | readonly string[]
            | Partial<ParsedArgs<{ dryRun: FlagSpec; printTask: FlagSpec }>>,
    ) => Promise<WorkerSlackResult>

    Dispatch with job-side Slack I/O. Default: lib/worker-slack's dispatchWithSlack.

    Type Declaration

      • (
            task: string,
            options: DispatchOptions,
            slackConfig: {
                accountId?: string;
                posts?: {
                    editTs?: string[];
                    pin?: boolean;
                    purpose: string;
                    target: string;
                }[];
                reads?: {
                    label: string;
                    limit?: number;
                    target: string;
                    threadTs?: string;
                }[];
            },
            flags?:
                | readonly string[]
                | Partial<ParsedArgs<{ dryRun: FlagSpec; printTask: FlagSpec }>>,
        ): Promise<WorkerSlackResult>
      • Dispatch a worker with job-side Slack I/O.

        Parameters

        • task: string

          Base TASK text.

        • options: DispatchOptions

          Runner dispatch options (jobId, thinking, timeout, …).

        • slackConfig: {
              accountId?: string;
              posts?: {
                  editTs?: string[];
                  pin?: boolean;
                  purpose: string;
                  target: string;
              }[];
              reads?: {
                  label: string;
                  limit?: number;
                  target: string;
                  threadTs?: string;
              }[];
          }

          Reads and allowed post targets (validated here).

          • OptionalaccountId?: string

            Gateway Slack account id (multi-account gateways, e.g. <account-id>).

          • Optionalposts?: { editTs?: string[]; pin?: boolean; purpose: string; target: string }[]

            Targets the worker may post to. Each normalized target may appear once: aliases (C… vs channel:C…) would otherwise overwrite each other's editTs/pin permissions order-dependently.

          • Optionalreads?: { label: string; limit?: number; target: string; threadTs?: string }[]

            Reads made before dispatch.

        • Optionalflags:
              | readonly string[]
              | Partial<ParsedArgs<{ dryRun: FlagSpec; printTask: FlagSpec }>>

          dryRun / printTask (lib/dispatcher-flags), or raw arguments to read them from (default: process.argv).

        Returns Promise<WorkerSlackResult>

        The run result.

        Error when the Slack config is invalid (before any side effect).

    log: (message: string) => void

    Logs the [skip] line and the previews.

    now: () => Date

    The current time, for the date context.

    runDispatcher: (task: string, options: DispatchOptions) => void

    Dispatch without Slack. Default: jeeves-runner's runDispatcher with core's spawn-worker.

    runMode?: () => RunMode

    How this run was started. Default: runModeOf the process environment.