getDeferredTasksForAgent = (handleName, agentName) => {
      /** @type {DeferredTasks<AgentDeferredTaskParams>} */
      const tasks = makeDeferredTasks();
      if (handleName !== undefined) {
        tasks.push(identifiers =>
          petStore.write(handleName, identifiers.handleId),
        );
      }
      if (agentName !== undefined) {
        tasks.push(identifiers =>
          petStore.write(agentName, identifiers.agentId),
        );
      }
      return tasks;
    }
@param {string} [handleName] - The pet name of the handle.
@param {string} [agentName] - The pet name of the agent.